﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Linq;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using Ozner.BLL;
using Ozner.Common;

namespace Ozner.UI
{
    /// <summary>
    /// 所有在TabMain中显示的窗口都应继承此窗口
    /// </summary>
    public partial class FrmModelBase : FrmBaseDev
    {
        private BaseModelBLL bll = new BaseModelBLL();
        public FrmModelBase()
        {
            InitializeComponent();
        }
        public FrmModelBase(string URL):this()
        {
            bll.URL = URL;
            this.Tag = URL;
            this.Load += FrmModelBase_Load;
        }

        private void FrmModelBase_Load(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(bll.URL))
            {
                ShowWaiting("正在查询页面信息...");

                //设置标题
                BaseResult<List<string>> br = ExecuteBLL<List<string>>(bll, "GetCurrentLocation");
                if (br.Code == Code.OK)
                {
                    string location = "";
                    foreach (string l in br.Object)
                    {
                        location += "/" + l;
                    }
                    lblLocation.Text = location;
                }
                CloseWaiting();
            }
        }
    }
}